﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MortgageMonitor.Report.DDL
{
    public class CustomerSumaryReport
    {
        public string CustomerName { set; get; }

        public string HoldingName { set; get; }
        public string AccountNo { set; get; }
        public decimal StockLoanValue { set; get; }
        public decimal StockValue { set; get; }
        public decimal CashValue { set; get; }
        public decimal AccLoan { set; get; }
        public decimal PerTotal
        {
            get
            {
                return TotalValue.Equals(0) ? 0 : (AccLoan * 100 / TotalValue);
            }
        }
        public decimal PerLoanLimit
        {
            get
            {
                return StockLoanValue.Equals(0) ? 0 : (AccLoan * 100 / (StockLoanValue + CashValue));
            }
        }
        public decimal PerTotalLoan { set; get; }
        public decimal TotalValue { set; get; }
        public decimal PerRealValue
        {
            get
            {
                return ((TotalValue - AccLoan) == 0) ? 0 : (AccLoan * 100) / (TotalValue - AccLoan);
            }
        }

        public CustomerSumaryReport() { }
        public CustomerSumaryReport(string cusname, string holdname, string accno, decimal loan, decimal stock, decimal cash, decimal total)
        {
            CustomerName = cusname;
            HoldingName = holdname;
            AccountNo = accno;
            StockLoanValue = loan;
            StockValue = stock;
            CashValue = cash;
            TotalValue = total;
        }
        public CustomerSumaryReport(string cusname, string holdname, string accno, decimal loan, decimal stock, decimal cash, decimal accloan, decimal pertotalloan, decimal total)
        {
            CustomerName = cusname;
            HoldingName = holdname;
            AccountNo = accno;
            StockLoanValue = loan;
            StockValue = stock;
            CashValue = cash;
            AccLoan = accloan;
            PerTotalLoan = pertotalloan;
            TotalValue = total;
        }
        // /public decimal 
    }

    public class AccountSummary
    {
        public string HoldingName { set; get; }
        public string AccountNo { set; get; }
        public decimal StockLoanValue { set; get; }
        public decimal StockValue { set; get; }
        public decimal CashValue { set; get; }
        public decimal TotalValue { set; get; }
        public decimal LoanValue { set; get; }

        public decimal CashRatio { set; get; }
        public decimal AllowRatio { set; get; }
        public decimal TotalRatio { set; get; }

        public AccountSummary() { }
    }
}
